﻿using System.Text.Json.Serialization;

namespace TK.Common.FFmpeg
{
    /// <summary>
    /// 视频格式化信息
    /// </summary>
    public class VideoFormatInfoDto
    {
        /// <summary>
        /// 视频格式化信息
        /// </summary>
        [JsonPropertyName("format")]
        public VideoInfoDto FormatInfo { get; set; }

        /// <summary>
        /// 非正常信息时，返回
        /// </summary>
        public string Error { get; set; }
    }

    /// <summary>
    /// 视频信息
    /// </summary>
    public class VideoInfoDto
    {
        /// <summary>
        /// 文件全名称
        /// </summary>
        [JsonPropertyName("filename")]
        public string FileName { get; set; }

        /// <summary>
        /// 文件包含流数量
        /// </summary>
        [JsonPropertyName("nb_streams")]
        public int NbStreamCount { get; set; }

        /// <summary>
        /// nb_programs
        /// </summary>
        [JsonPropertyName("nb_programs")]
        public int NbProgramCount { get; set; }

        /// <summary>
        /// 文件封装格式名称
        /// </summary>
        [JsonPropertyName("format_name")]
        public string FormatName { get; set; }

        /// <summary>
        /// 文件封装格式名称
        /// </summary>
        [JsonPropertyName("format_long_name")]
        public string FormatLongName { get; set; }

        /// <summary>
        /// 开始时间（秒）
        /// </summary>
        [JsonPropertyName("start_time")]
        public string StartTime { get; set; }

        /// <summary>
        /// 时长（秒）
        /// </summary>
        [JsonPropertyName("duration")]
        public string Duration { get; set; }

        /// <summary>
        /// 文件大小（字节）
        /// </summary>
        [JsonPropertyName("size")]
        public string Size { get; set; }

        /// <summary>
        /// 帧率
        /// </summary>
        [JsonPropertyName("bit_rate")]
        public string BitRate { get; set; }

        /// <summary>
        /// probe_score
        /// </summary>
        [JsonPropertyName("probe_score")]
        public uint ProbeScore { get; set; }

        /// <summary>
        /// tags
        /// </summary>
        [JsonPropertyName("tags")]
        public VideoTagDto VideoTag { get; set; }
    }

    /// <summary>
    /// 视频标签
    /// </summary>
    public class VideoTagDto
    {
        /// <summary>
        /// major_brand
        /// </summary>
        [JsonPropertyName("major_brand")]
        public string MajorBrand { get; set; }

        /// <summary>
        /// minor_version
        /// </summary>
        [JsonPropertyName("minor_version")]
        public string MinorVersion { get; set; }

        /// <summary>
        /// compatible_brands
        /// </summary>
        [JsonPropertyName("compatible_brands")]
        public string CompatibleBrands { get; set; }

        /// <summary>
        /// encoder
        /// </summary>
        [JsonPropertyName("encoder")]
        public string Encoder { get; set; }
    }
}
